<template>
  <div>
    <h1>开发者列表</h1>
    <ul>
      <li v-for="dev in developers" :key="dev.id">
        {{ dev.name }} - TalentRank: {{ dev.contribution }}
      </li>
    </ul>
  </div>
</template>

<script>
import { fetchDevelopers } from '../api';

export default {
  data() {
    return {
      developers: []
    };
  },
  created() {
    fetchDevelopers()
      .then(response => {
        this.developers = response.data;
      })
      .catch(error => {
        console.error('Error fetching developers:', error);
      });
  }
};
</script>